import club.fuwenhao.bean.DemoData;
import club.fuwenhao.bean.DemoData03;
import club.fuwenhao.config.DemoDataListener;
import club.fuwenhao.config.UserExcelListener;
import club.fuwenhao.config.openDataExcelListener;
import com.alibaba.excel.EasyExcel;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

/**
 * @program: fwh-excel
 * @description: read test
 * @author: fwh
 * @date: 2021-12-31 10:16
 **/
@Slf4j
public class ExcelReadTest02{
    @Test
    public void simpleRead() {
        String fileName = "/Users/ext.tianlixia/temp/simpleWrite1640921941657.xlsx";
        // 这里 需要指定读用哪个class去读，然后读取第一个sheet 文件流会自动关闭
//        EasyExcel.read(fileName, DemoData.class, new DemoDataListener()).sheet().doRead();
        EasyExcel.read(fileName, DemoData.class, new UserExcelListener()).sheet().doRead();
    }

    @Test
    public void projectTest() {
        String fileName = "/Users/ext.tianlixia/temp/readTest.xlsx";
        EasyExcel.read(fileName, DemoData03.class, new openDataExcelListener()).sheet().doRead();
    }
}
